angular.module("howMuch", ["ngRoute", "pascalprecht.translate", "howMuch.controllers"]);

angular.module('howMuch').config([
	'$routeProvider', '$translateProvider',
	function($routeProvider, $translateProvider){
		$routeProvider.when("/", 
			{ templateUrl: "views/dashboard.html", controller: "DashboardController" }
		);
		$routeProvider.when("/customers", 
			{ templateUrl: "views/customers.html", controller: "CustomerController" }
		);
		$routeProvider.when("/projects", 
			{ templateUrl: "views/projects.html", controller: "ProjectController" }
		);
		$routeProvider.when("/sessions", 
			{ templateUrl: "views/sessions.html", controller: "WorkSessionController" }
		);
		$routeProvider.when("/invoices/:projectId", 
			{ templateUrl: "views/invoices.html", controller: "InvoiceController" }
		);
		$routeProvider.when("/invoices", 
			{ templateUrl: "views/invoices.html", controller: "InvoiceController" }
		);
		$routeProvider.when("/settings",
			{ templateUrl: "views/settings.html", controller: "SettingsController" }
		);
		
		$routeProvider.otherwise({ redirectTo: "/" });

		$translateProvider.useStaticFilesLoader({
            prefix: '/lang/',
            suffix: '.json'
        });

        $translateProvider.preferredLanguage('it');
	}
]);